#define _CRT_SECURE_NO_WARNINGS 1
class MyQueue {
public:
    MyQueue() {

    }

    void push(int x)
    {
        inSt.push(x);
    }

    int pop()
    {
        if (this->empty())
        {
            return -1;
        }
        if (outSt.empty())
        {
            while (!inSt.empty())
            {
                outSt.push(inSt.top());
                inSt.pop();
            }
        }
        int ret = outSt.top();
        outSt.pop();
        return ret;
    }

    int peek()
    {
        if (outSt.empty())
        {
            while (!inSt.empty())
            {
                outSt.push(inSt.top());
                inSt.pop();
            }
        }
        return outSt.top();
    }

    bool empty()
    {
        return outSt.empty() & inSt.empty();
    }
private:
    stack<int> inSt;
    stack<int> outSt;
};

/**
 * Your MyQueue object will be instantiated and called as such:
 * MyQueue* obj = new MyQueue();
 * obj->push(x);
 * int param_2 = obj->pop();
 * int param_3 = obj->peek();
 * bool param_4 = obj->empty();
 */